﻿using System.Data.Entity.ModelConfiguration;
using OneBlog.Model.Entities;

namespace OneBlog.DataAccessLayer.ModelConfigurations
{
    public class BlogSubCommentMap:EntityTypeConfiguration<BlogSubComment>
    {
        public BlogSubCommentMap()
        {
            ToTable("BlogSubComment");
            Property(c => c.Content).HasMaxLength(400);

            HasRequired(c => c.CreateUser).WithMany().HasForeignKey(c => c.CreateUserId);
            HasRequired(c => c.RepleyUser).WithMany().HasForeignKey(c => c.RepleyUserId);
        }
    }
}